package ACWing.WeeklyRace;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author :chenjie
 * @date :Created 2022/12/24 20:28
 */
public class MakeABreakthrough {
    static long max;
    static int m;
    static boolean[]st=new boolean[110];
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        m=sc.nextInt();
        int[]arr=new int[n+1];
        int[]t=new int[m];
        long sum=0;
        for (int i = 1; i <= n; i++) {
            arr[i]=sc.nextInt();
            sum=sum+arr[i];
        }
        for (int i = 0; i < m; i++) {
            int x=sc.nextInt();
            t[i]=arr[x];
            sum=sum-arr[x];
            arr[x]=-1;
        }
        Arrays.sort(t);
//        max=sum;
//        dfs(sum,t,0);
        max=t[m-1];
        for (int i = m-1; i >=0; i--) {
            if(sum<=t[i]){
                sum=sum+t[i];
            }else {
                sum=sum*2;
            }
        }
        System.out.println(sum);
//        System.out.println(max);
    }
    public static void dfs(long sum,int[]arr,int u){
        if(sum>max){
            max=sum;
        }
        if(u==m){
            return;
        }
        for (int i = 0; i < m; i++) {
            if(!st[i]){
                st[i]=true;
                if(sum>arr[i]){
                    sum=sum*2;
                    dfs(sum,arr,u+1);
                    sum=sum/2;
                }else {
                    sum=sum+arr[i];
                    dfs(sum,arr,u+1);
                    sum=sum-arr[i];
                }
                st[i]=false;
            }
        }
    }
}
